Page({
    data: {
        // 内容列表
        list: [{

                "cid": 0,
                "cname": "地坛公园",
            },

            {

                "cid": 0,
                "cname": "月坛",
            },

            {

                "cid": 0,
                "cname": "社稷坛",
            },

            {

                "cid": 0,
                "cname": "先农坛",
            },

            {

                "cid": 0,
                "cname": "天坛",
            },

        ]
    },

    // 跳转到详情页
    goDetail: function (event) {
        console.log(event)
        // 如果cid==0不跳转
        const item = event.currentTarget.dataset.item;
        const cid = item.cid;
        if (cid != 0) {
            wx.navigateTo({
                url: '/pages/attraction-detail/attraction-detail?item=' + encodeURIComponent(JSON.stringify(item))
            });
        }

    },
})